﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MotionCS.Controller;

namespace MotionCS.Module
{
    public class SmemaAction
    {
        /// <summary>
        /// 上游有板
        /// </summary>
        public IDiBit DiFrontReady;
        /// <summary>
        /// 下游要板
        /// </summary>
        public IDiBit DiAfterReady;
        /// <summary>
        /// 本机就绪
        /// </summary>
        public IDoBit DoFrontReady;
        /// <summary>
        /// 本机待取
        /// </summary>
        public IDoBit DoAfterReady;
        /// <summary>
        /// 检测结果
        /// </summary>
        public IDoBit DoCheckReady;

        /// <summary>
        /// 构造函数
        /// </summary>
        public SmemaAction()
        {
        }
        /// <summary>
        /// 本机要板打开
        /// </summary>
        public void FrontReadyTurnOn()
        {
            DoFrontReady.TurnOn();
        }
        /// <summary>
        /// 本机要板关闭
        /// </summary>
        public void FrontReadyTurnOff()
        {
            DoFrontReady.TurnOff();
        }
        /// <summary>
        /// 本机有板打开
        /// </summary>
        public void AfterReadyTurnOn()
        {
            DoAfterReady.TurnOn();
        }
        /// <summary>
        /// 本机有板关闭
        /// </summary>
        public void AfterReadyTurnOff()
        {
            DoAfterReady.TurnOff();
        }
        /// <summary>
        /// 检测结果OK
        /// </summary>
        public void CheckReadyTurnOn()
        {
            DoCheckReady.TurnOn();
        }
        /// <summary>
        /// 检测结果NG
        /// </summary>
        public void CheckReadyTurnOff()
        {
            DoCheckReady.TurnOff();
        }
        /// <summary>
        /// 上游是否有板
        /// </summary>
        /// <returns></returns>
        public bool IsFrontReady()
        {
            return DiFrontReady.IsOn();
        }
        /// <summary>
        /// 下游是否要板
        /// </summary>
        /// <returns></returns>
        public bool IsAfterReady()
        {
            return DiAfterReady.IsOn();
        }
    }
}
